Fixed-Strain diffusion flames#22
Conversation
|
Could you also add the counter-flow flamelets to the flamelet options in |
EvertBunschoten
left a comment
There was a problem hiding this comment.
The warm restart functionality can be improved. In its current form, it seems quite redundant as the adiabatic and burner-stabilized flamelets already restart from the previously converged solution object without having to write a yaml file.
| self.__counterflow_fixed_strain = getattr(self._Config, '_Config_FGM__counterflow_fixed_strain', DefaultSettings_FGM.counterflow_fixed_strain) | ||
| self.__counterflow_strain_rate = getattr(self._Config, '_Config_FGM__counterflow_strain_rate', DefaultSettings_FGM.counterflow_strain_rate) | ||
| try: | ||
| self.__counterflow_fixed_strain = self._Config.GetCounterFlowFixedStrain() | ||
| self.__counterflow_strain_rate = self._Config.GetCounterFlowStrainRate() | ||
| except AttributeError: | ||
| pass |
There was a problem hiding this comment.
This seems redundant. Why is there a try/except around the getter function from the config?
| # Build output paths early so we can check for existing files. | ||
| if not path.isdir(self.GetOutputDir()+'/freeflame_data/'): | ||
| mkdir(self.GetOutputDir()+'/freeflame_data/') | ||
| if not path.isdir(self.GetOutputDir()+'/freeflame_data/'+folder_header+'_'+str(round(mix_status, 6))): | ||
| mkdir(self.GetOutputDir()+'/freeflame_data/'+folder_header+'_'+str(round(mix_status, 6))) | ||
| freeflame_filename = "freeflamelet_"+folder_header+str(round(mix_status,6))+"_Tu"+str(round(T_ub, 4))+".csv" | ||
| filename_plus_folder = self.GetOutputDir()+"/freeflame_data/"+folder_header+'_'+str(round(mix_status, 6)) + "/"+freeflame_filename | ||
| yaml_plus_folder = filename_plus_folder.replace('.csv', '.yaml') | ||
|
|
||
| # If a YAML exists, restore as warm-start before solving. | ||
| # Always re-solve and overwrite the CSV (use auto=False when restoring). | ||
| warm_started = False | ||
| if path.isfile(yaml_plus_folder): | ||
| try: | ||
| freeflame.restore(yaml_plus_folder, 'solution') | ||
| warm_started = True | ||
| print("Freeflame at %s %.3e, Tu %.3f: warm-start from YAML." % (folder_header, mix_status, T_ub)) | ||
| except Exception as exc: | ||
| print("Freeflame at %s %.3e, Tu %.3f: YAML restore failed (%s), re-solving from scratch." % (folder_header, mix_status, T_ub, exc)) | ||
|
|
There was a problem hiding this comment.
I don't understand the purpose of these lines. Lines 481-483 already describe a warm restart capability by just using the previously converged FreeFlame solution.
| _, nearest_yaml = min(candidates) | ||
| guess_path = path.join(out_dir, nearest_yaml) | ||
| try: | ||
| flame.restore(guess_path, 'solution') |
There was a problem hiding this comment.
Similarly as to the FreeFlame and BurnerFlame solutions, why not restart from the previously converged solution object rather than reading the yaml file?
| 97.0,0.0009485280024819076,4.2398760696917305e-05 | ||
| 98.0,0.0009390524355694652,4.2575587079161074e-05 | ||
| 99.0,0.000929671514313668,4.283483808240152e-05 | ||
| 0.0,0.002511886414140463,0.0032617408828994787 |
There was a problem hiding this comment.
I suggest not changing the training history reference file until the flamelet generation regression test passes.
| consistency_NICFD_PINN = TestCase("PIML training NICFD") | ||
| consistency_NICFD_PINN.config_dir = "FluidTraining/MM_PINN/" | ||
| consistency_NICFD_PINN.config_file = "" | ||
| consistency_NICFD_PINN.tolerance= 0.01 |
There was a problem hiding this comment.
Why was the tolerance of this regression test adapted? Your changes to the code should not affect the functionalities for NICFD.
Proposed Changes
Give a brief overview of your contribution here in a few sentences.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.